<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>
<body>
  <div>Header</div>
  <div id="app">app</div>
  <div>Footer</div>

  <!-- 1.引用react -->
  <script src="https://unpkg.com/react@16/umd/react.development.js"></script>
  <script src="https://unpkg.com/react-dom@16/umd/react-dom.development.js"></script>
  <script src="https://unpkg.com/babel-standalone@6.15.0/babel.min.js"></script>

  <!-- 2.使用react -->
  <script type="text/babel">
   class App extends React.Component {
     constructor() {
       super()
       this.state = {
         name: "哈哈哈",
         arr: [1, 2, 3],
         test1: null,
         test2: undefined,
         test3: false,
         obj: {
           name: "yz"
         }
       }
     }
     render() {
       return (
         <div>
          <h2>{this.state.name}</h2>
          {/* 自动解构 */}
          <h2>{this.state.arr}</h2>
          {/* 下面啥都不显示 */}
          <h2>{this.state.test1}</h2>
          <h2>{this.state.test2}</h2>
          <h2>{this.state.test3}</h2>
          <h2>{this.state.obj}</h2>
         </div>
       )
     }
   }
   ReactDOM.render(<App/>, document.getElementById("app"))
  </script>
</body>
</html>
